<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::group(['prefix' => 'v1','middleware'=>'shop_api_auth'], function ($router) {
    //登录
	Route::post('shop_api/login/login', 'v1\AuthController@login');
	//我的信息
	Route::post('shop_api/login/my', 'v1\AuthController@my');
	
	
	//我的收藏
	Route::get('shop_api/my/my_collect', 'v1\AuthController@my_collect');
	//我的收藏查看
	Route::put('shop_api/my/my_collect_look', 'v1\AuthController@my_collect_look');
	
	//修改头像
	Route::put('shop_api/my/edit_avatar', 'v1\AuthController@edit_avatar');
	//修改昵称
	Route::put('shop_api/my/edit_nick_name', 'v1\AuthController@edit_nick_name');
	
	//退出登录
	Route::delete('shop_api/login/logout', 'v1\AuthController@logout');
	//刷新token
    Route::put('shop_api/login/refresh', 'v1\AuthController@refresh');
    
	//获取关于我们信息
	Route::get('shop_api/config/content', 'v1\AuthController@config_content');

	//获取商城配置信息
	Route::get('shop_api/config/info','v1\AuthController@config_info');
	
	
	
	//单图上传
	Route::post('shop_api/upload/upload_file', 'v1\UploadController@upload_file');
	
	//生成二维码
	Route::get('shop_api/upload/get_api_code', 'v1\UploadController@get_api_code');
	
	
	//首页轮播图
	Route::get('shop_api/index/baner_list', 'v1\IndexController@baner_list');
	//轮播图详情
	Route::get('shop_api/index/swiper_detail', 'v1\IndexController@swiper_detail');
	//首页商品分类
	Route::get('shop_api/index/product_type', 'v1\IndexController@product_type');
	//首页精品推荐
	Route::get('shop_api/index/recommend_product_list', 'v1\IndexController@recommend_product_list');
	//首页热卖单品
	Route::get('shop_api/index/best_product_list', 'v1\IndexController@best_product_list');
	//商品列表
	Route::get('shop_api/index/product_list', 'v1\IndexController@product_list');
	//商品详情
	Route::get('shop_api/index/product_info', 'v1\IndexController@product_info');
	//商品收藏
	Route::post('shop_api/index/product_collect', 'v1\IndexController@product_collect');
	//商品评价列表
	Route::get('shop_api/index/product_comments_list', 'v1\IndexController@product_comments_list');
	
	//热搜列表
	Route::get('shop_api/index/top_search_list', 'v1\IndexController@top_search_list');
	
	//商品一级分类
	Route::get('shop_api/product_type/product_type_one', 'v1\ProductTypeController@product_type_one');
	//商品二级三级分类
	Route::get('shop_api/product_type/product_type_two', 'v1\ProductTypeController@product_type_two');
	
	//分类轮播图
	Route::get('shop_api/product_type/product_type_banner_list', 'v1\ProductTypeController@product_type_banner_list');
	
	
	
	//加入购物车
	Route::post('shop_api/cart/add_cart', 'v1\CartController@add_cart');
	
	//购物车列表
	Route::get('shop_api/cart/cart_list', 'v1\CartController@cart_list');
	
	//购物车加
	Route::put('shop_api/cart/cart_add', 'v1\CartController@cart_add');
	
	//购物车减
	Route::put('shop_api/cart/cart_subtract', 'v1\CartController@cart_subtract');
	
	//购物车删除
	Route::delete('shop_api/cart/cart_delete', 'v1\CartController@cart_delete');
	
	//商品详情立即购买
	Route::post('shop_api/order/add_product_order', 'v1\OrderController@add_product_order');
	
	
	//购物车结算
	Route::post('shop_api/order/add_cart_order', 'v1\OrderController@add_cart_order');
	
	//订单列表
	Route::get('shop_api/order/order_list', 'v1\OrderController@order_list');
	
	
	
	
	
	
	//获取省市区
	Route::get('shop_api/site/get_area', 'v1\SiteController@get_area');
	
	//获取我的收获地址
	Route::get('shop_api/site/get_user_site', 'v1\SiteController@get_user_site');
	//添加地址
	Route::post('shop_api/site/add_site', 'v1\SiteController@add_site');
	//地址列表
	Route::get('shop_api/site/site_list', 'v1\SiteController@site_list');
	//地址编辑页面数据
	Route::get('shop_api/site/get_list_info', 'v1\SiteController@get_list_info');
	//地址编辑
	Route::put('shop_api/site/edit_site', 'v1\SiteController@edit_site');
	//地址删除
	Route::delete('shop_api/site/delete_site', 'v1\SiteController@delete_site');
	
	
	//获取充值模板列表
	Route::get('shop_api/recharge/get_recharge_list', 'v1\RechargeController@get_recharge_list');
	
	//获取充值记录列表
	Route::get('shop_api/recharge/get_recharge_log_list', 'v1\RechargeController@get_recharge_log_list');
});











